/** 头条推广系统路由模块 **/
import { BasicLayout } from '@/layouts'
import { bxAnaalyse,batch,promoteIcon,accountIcon } from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: (h) => h('router-view')
}

const TouTiaoADVRouter = {
  path: '/',
  name: 'index',
  component: BasicLayout,
  meta: { title: 'menu.home' },
  redirect: '/dashboard/index',
  children: [
    {
      path: '/dashboard',
      name: 'dashboard',
      // redirect: '/dashboard/index',
      component: RouteView,
      meta: { title: '控制台', keepAlive: true, icon: bxAnaalyse },
      children: [
        {
          path: '/dashboard/index',
          name: 'index',
          component: () => import('@/views/ADV/TouTiaoADV/Dashboard/index'),
          meta: { title: '首页', keepAlive: false }
        }
      ]
    },
    // {
    //   path: '/test',
    //   name: '测试页面',
    //   component: RouteView,
    //   meta: { title: '测试页面', keepAlive: true, icon: bxAnaalyse },
    //   children: [
    //     {
    //       path: 'index',
    //       name: 'test',
    //       component: () => import('@/views/ADV/TouTiaoADV/test/index'),
    //       meta: { title: '测试页面', keepAlive: false }
    //     }
    //   ]
    // },
    {
      path: '/batch',
      name: 'batch',
      component: RouteView,
      meta: { title: '批量', keepAlive: true, icon: batch },
      children: [
        {
          path: 'create',
          name: 'batch',
          component: () => import('@/views/ADV/TouTiaoADV/Batch/index'),
          meta: { title: '批量创建', keepAlive: true}
        },
        {
          path: 'task',
          name: 'batchTask',
          component: () => import('@/views/ADV/TouTiaoADV/BatchTask/index'),
          meta: { title: '批量任务', keepAlive: false }
        },
        {
          path: 'async',
          name: 'async',
          component: () => import('@/views/ADV/TouTiaoADV/asyncTask/index'),
          meta: { title: '同步任务', keepAlive: true}
        },
        {
          path: 'update',
          name: 'update',
          component: () => import('@/views/ADV/TouTiaoADV/updateTask/index'),
          meta: { title: '更新任务', keepAlive: true}
        },
      ]
    },
    {
      path: '/promote',
      name: 'promote',
      redirect: '/promote/campaign',
      component: RouteView,
      meta: { title: '推广', keepAlive: true, icon: promoteIcon, permission: ['promote'] },
      children: [
        {
          path: 'campaign',
          name: 'campaign',
          component: () => import('@/views/ADV/TouTiaoADV/Campaign/index'),
          meta: { title: '广告组', keepAlive: false }
        },
        {
          path: 'plans',
          name: 'plans',
          component: () => import('@/views/ADV/TouTiaoADV/Ad/index'),
          meta: { title: '计划', keepAlive: false }
        },
        {
          path: 'adConvert',
          name: 'adConvert',
          component: () => import('@/views/ADV/TouTiaoADV/AdConvert/index'),
          meta: { title: '转化配置', keepAlive: false}
        },
        {
          path: 'audienceTemplete',
          name: 'audienceTemplete',
          component: () => import('@/views/ADV/TouTiaoADV/AudienceTemplete/index'),
          meta: { title: '定向包', keepAlive: false }
        }
      ]
    },
    {
      path: '/account',
      name: 'account',
      component: RouteView,
      meta: { title: '账户', keepAlive: true, icon: accountIcon },
      children: [
        {
          path: 'index',
          name: 'account',
          component: () => import('@/views/ADV/TouTiaoADV/Account/index'),
          meta: { title: '广告投放账号', keepAlive: false }
        }
      ]
    }
  ]
}
export default TouTiaoADVRouter
